package com.sxg.service.impl;

import java.util.List;

import com.sxg.common.annotation.DataSource;
import com.sxg.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sxg.mapper.GoodsDetailMapper;
import com.sxg.domain.GoodsDetail;
import com.sxg.service.IGoodsDetailService;

/**
 * 商品详情信息Service业务层处理
 * 
 * @author 浪漫写尽歌谱
 * @date 2024-01-09
 */
@Service
@DataSource(value = DataSourceType.SLAVE)
public class GoodsDetailServiceImpl implements IGoodsDetailService 
{
    @Autowired
    private GoodsDetailMapper goodsDetailMapper;

    /**
     * 查询商品详情信息
     * 
     * @param goodsId 商品详情信息主键
     * @return 商品详情信息
     */
    @Override
    public GoodsDetail selectGoodsDetailByGoodsId(Long goodsId)
    {
        return goodsDetailMapper.selectGoodsDetailByGoodsId(goodsId);
    }

    /**
     * 查询商品详情信息列表
     * 
     * @param goodsDetail 商品详情信息
     * @return 商品详情信息
     */
    @Override
    public List<GoodsDetail> selectGoodsDetailList(GoodsDetail goodsDetail)
    {
        return goodsDetailMapper.selectGoodsDetailList(goodsDetail);
    }

    /**
     * 新增商品详情信息
     * 
     * @param goodsDetail 商品详情信息
     * @return 结果
     */
    @Override
    public int insertGoodsDetail(GoodsDetail goodsDetail)
    {
        return goodsDetailMapper.insertGoodsDetail(goodsDetail);
    }

    /**
     * 修改商品详情信息
     * 
     * @param goodsDetail 商品详情信息
     * @return 结果
     */
    @Override
    public int updateGoodsDetail(GoodsDetail goodsDetail)
    {
        return goodsDetailMapper.updateGoodsDetail(goodsDetail);
    }

    /**
     * 批量删除商品详情信息
     * 
     * @param goodsIds 需要删除的商品详情信息主键
     * @return 结果
     */
    @Override
    public int deleteGoodsDetailByGoodsIds(Long[] goodsIds)
    {
        return goodsDetailMapper.deleteGoodsDetailByGoodsIds(goodsIds);
    }

    /**
     * 删除商品详情信息信息
     * 
     * @param goodsId 商品详情信息主键
     * @return 结果
     */
    @Override
    public int deleteGoodsDetailByGoodsId(Long goodsId)
    {
        return goodsDetailMapper.deleteGoodsDetailByGoodsId(goodsId);
    }
}
